import JQuery from 'jquery';

let table = {
    setAttribute: function(element) {
        if (element.component === 'VTable') {
            this.setValue(this.getTableSpeedName(), element.attribute.interval);
        }
    },
    setTableSpeed: function(element, value, updateInput = true) {
        element.attribute.interval = +value;
        updateInput && this.setValue(this.getTableSpeedName(), value);
    },
    setValue: function(id, value) {
        let obj = JQuery('#' + id);
        obj.val(value);
    },
    getTableSpeedName: function() {
        return window.getRootName() + 'ATTRIBUTE_INTERVAL';
    }
};
export default table;